# -*- coding: utf-8 -*- 
# @project : 《Atcoder》
# @Author : created by bensonrachel on 2021/11/15
# @File : 227.A - Last Card.py

n,k,a = map(int,input().split())
tmp = (k%n)
tmp2 = a + tmp - 1
if tmp2 > n:
    tmp2 = tmp2 - n
if tmp2 == 0:
    tmp2 = n
print(tmp2)
